package io.jt808.proto.item;


import io.norland.buffer.AutoBuffer;
import io.norland.proto.IProto;


public class PositionAdditional04AlarmEventId implements IProto {
    private int alarmEventId;

    public byte[] writeToBytes() {
        AutoBuffer buffer = new AutoBuffer();
        buffer.writeShort(this.alarmEventId);
        return buffer.array();
    }

    public void readFromBuf(AutoBuffer buffer) {
        this.alarmEventId = buffer.readShort();
    }

    public int getAlarmEventId() {
        return this.alarmEventId;
    }

    public void setAlarmEventId(int alarmEventId) {
        this.alarmEventId = alarmEventId;
    }

    public boolean equals(Object o) {
        if (o == this) return true;
        if (!(o instanceof PositionAdditional04AlarmEventId)) return false;
        PositionAdditional04AlarmEventId other = (PositionAdditional04AlarmEventId) o;
        if (!other.canEqual(this)) return false;
        return getAlarmEventId() == other.getAlarmEventId();
    }

    protected boolean canEqual(Object other) {
        return other instanceof PositionAdditional04AlarmEventId;
    }

    public int hashCode() {
        int PRIME = 59;
        int result = 1;
        return result * 59 + getAlarmEventId();
    }

    public String toString() {
        return "PositionAdditional04AlarmEventId(alarmEventId=" + getAlarmEventId() + ")";
    }
}